/*  1:   */ package com.htxx.security.cipher;
/*  2:   */ 
/*  3:   */ public class CommonBean
/*  4:   */ {
/*  5:   */   public static String byte2hex(byte[] b)
/*  6:   */   {
/*  7:15 */     String hs = "";
/*  8:16 */     String stmp = "";
/*  9:18 */     for (int n = 0; n < b.length; n++)
/* 10:   */     {
/* 11:20 */       stmp = Integer.toHexString(b[n] & 0xFF);
/* 12:21 */       if (stmp.length() == 1) {
/* 13:22 */         hs = hs + "0" + stmp;
/* 14:   */       } else {
/* 15:24 */         hs = hs + stmp;
/* 16:   */       }
/* 17:   */     }
/* 18:26 */     return hs;
/* 19:   */   }
/* 20:   */   
/* 21:   */   public static byte[] hex2byte(String s)
/* 22:   */   {
/* 23:31 */     byte[] byteCode = (byte[])null;
/* 24:32 */     int count = 0;
/* 25:   */     
/* 26:34 */     count = s.length() / 2;
/* 27:   */     
/* 28:   */ 
/* 29:37 */     byteCode = new byte[count];
/* 30:38 */     for (int i = 0; i < count; i++) {
/* 31:40 */       byteCode[i] = Integer.valueOf(s.substring(i * 2, i * 2 + 2), 16).byteValue();
/* 32:   */     }
/* 33:44 */     return byteCode;
/* 34:   */   }
/* 35:   */ }


/* Location:           D:\htjs\document\wsrz\WsrzEjbInf\
 * Qualified Name:     com.htxx.security.cipher.CommonBean
 * JD-Core Version:    0.7.0.1
 */